IF OBJECT_ID('dbo.GetPCROManagerTypes') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.GetPCROManagerTypes
    IF OBJECT_ID('dbo.GetPCROManagerTypes') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.GetPCROManagerTypes >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.GetPCROManagerTypes >>>'
END
go
-- =======================================================================
-- Procedure Name: dbo.GetPCROManagerTypes
--
-- Author:      Kevin Cashman Parallax Consulting LLC
--
-- Create date: 09/10/08
--
-- Description: Returns list of Manager types for TurnAround Report
--        Depends on AnalisysType
--
-- Parameters:  @AnalysisType
--              @DomainUserId 
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.GetPCROManagerTypes 'WorkingBudget', 11055
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 09/10/08    KC        Created
--
-- =======================================================================
CREATE PROCEDURE dbo.GetPCROManagerTypes
     (@AnalysisType               VARCHAR(20)=NULL,
     @DomainUserId                INT)
AS

     SET NOCOUNT ON 

     IF @AnalysisType IN ('WorkingBudget','MCA')
          SELECT    1 AS Id,
                    'PreAwardManager' AS ManagerType
     
     ELSE
     IF @AnalysisType = 'Contract'
          SELECT    1 AS Id,
                    'CSCRCaseManager' AS ManagerType
     
     ELSE
     IF @AnalysisType = 'Proposal'
          SELECT    1 AS Id,
                    'CSCRCaseManager' AS ManagerType
          UNION
          SELECT    2,
                    'PreAwardManager'
     
     ELSE
          SELECT    NULL AS Id,
                    NULL AS Managertype
     


GO
IF OBJECT_ID('dbo.GetPCROManagerTypes') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.GetPCROManagerTypes >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.GetPCROManagerTypes >>>'
go


GRANT EXECUTE ON dbo.GetPCROManagerTypes TO InsightReport,Insight
go

